<?php
/**
 * +----------------------------------------------------------------------
 * | summer framework
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020 https://github.com/suframe/think-admin All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: summer <806115620@qq.com>  2020/3/30 13:55
 * +----------------------------------------------------------------------
 */

namespace app\mall\enum;


class ScoreEnum extends Base
{

    public const SCORE_1 = 1;
    public const SCORE_2 = 2;
    public const SCORE_3 = 3;
    public const SCORE_4 = 4;
    public const SCORE_5 = 5;

    public static function toZhArray(): array
    {
        return [
            self::SCORE_1 => '1分',
            self::SCORE_2 => '2分',
            self::SCORE_3 => '3分',
            self::SCORE_4 => '4分',
            self::SCORE_5 => '5分',
        ];
    }

    public function getEvaluate()
    {
        switch ($this->getValue()){
            case static::SCORE_1;
            case static::SCORE_2;
                return '差评';
            case static::SCORE_3;
            case static::SCORE_4;
                return '中评';
            case static::SCORE_5;
                return '好评';
        }
        return '默认好评';
    }

}